/* VIMApplication.h */

#import "VIMTextView.h"
#import "VIMTextStorage.h"

enum {
    ClearAllDrawType = 1,
    ClearBlockDrawType,
    DeleteLinesDrawType,
    ReplaceStringDrawType,
    InsertLinesDrawType
};

@interface NSApplication (VimAdditions)
- (void) setAppleMenu:(NSMenu *)aMenu;
@end

@interface VIMApplication: NSApplication

{
    VIMTextView    *contentView;
    VIMTextStorage *textStorage;
    BOOL            running;
    NSMutableData  *drawData;
    
    int             backgroundColor;
    int             foregroundColor;
    int             defaultBackgroundColor;
    int             defaultForegroundColor;
}

- (void) initializeApplicationTimer:(NSTimer *)timer;
- (void) menuAction:(id)sender;

- (void) createApplicationMenu;
- (void) createWindow;
- (VIMTextView *) contentView;
- (VIMTextStorage *) textStorage;

- (void) setRunning:(BOOL)isRunning;
- (BOOL) running;

- (void) performBatchDrawWithData:(NSData *)data;
- (void) flushDrawing;

- (void)clearAll;
- (void)clearBlockFromRow:(int)row1 column:(int)col1
                    toRow:(int)row2 column:(int)col2;
- (void)deleteLinesFromRow:(int)row count:(int)count
              scrollBottom:(int)bottom left:(int)left right:(int)right;
- (void)replaceString:(char*)s length:(int)len row:(int)row column:(int)col
                flags:(int)flags;
- (void)insertLinesFromRow:(int)row count:(int)count
              scrollBottom:(int)bottom left:(int)left right:(int)right;

- (void) setDefaultColorsBackground:(int)bg foreground:(int)fg;
- (void) setBackgroundColor:(int)color;
- (void) setForegroundColor:(int)color;

- (NSSize) contentSizeForTextViewSize:(NSSize)textViewSize;
- (NSRect)textViewRectForContentSize:(NSSize)contentSize;
- (void) fitWindowToTextStorage;
- (NSRect) fitWindowToFrame:(NSRect)frame;

@end

